package cn.com.twoke.easyproject.common.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;

@Builder
@Data
@Schema(description = "统一返回对象实体")
public class Result<T> {
    /**
     * 前端可显示的消息提示
     */
    @Schema(description = "消息提示，供前端显示业务错误提示")
    private final String message;
    /**
     * 供前后端调试时的错误提示
     */
    @Schema( description = "错误提示，供前后端调试")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private final String tips;
    /**
     * 返回的数据
     */
    @Schema(description = "返回的数据")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private final T data;
    /**
     * 业务编码，除了业务异常以外均与http请求状态一致
     */
    @Schema(description = "业务编码，除了业务异常以外均与http请求状态一致")
    private final Integer code;

}
